home *** CD-ROM | disk | FTP | other *** search
-
-
-
- bsearch C Library Procedures bsearch
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- bsearch - Binary search
-
- SSYYNNOOPPSSIISS
- vvooiidd **bbsseeaarrcchh((kkeeyy,, bbaassee,, nn,, ssiizzee,, ccmmpp))
-
- AARRGGUUMMEENNTTSS
- void *_k_e_y; Pointer to the object being
- searched for.
-
- void *_b_a_s_e; Pointer to the base of the array
- to search.
-
- size_t _n; Number of items in the array.
-
- size_t _s_i_z_e; Size of each item.
-
- int (*_c_m_p)(); Function to compare two items.
-
- _________________________________________________________________
-
-
- DDEESSCCRRIIPPTTIIOONN
- BBsseeaarrcchh searches bbaassee[[00]] ...... bbaassee[[nn -- 11]] for an item that
- matches **kkeeyy. The function ccmmpp must return negative if its
- first argument (the search key) is less than its second (a
- table entry), zero if equal, and positive if greater. Items
- in the array bbaassee must be in ascending order. bbsseeaarrcchh
- returns a pointer to a matching item, or NNUULLLL if none exits.
-
-
- KKEEYYWWOORRDDSS
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: June 29, 1989 1
-
-
-
-